package exam;
import java.util.HashMap;
import java.util.Map;

class BankCustomer {
    private String id;
    private String name;
    private double balance;

    public BankCustomer(String id, String name, double balance) {
        this.id = id;
        this.name = name;
        this.balance = balance;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getBalance() {
        return balance;
    }

    public void setBalance(double balance) {
        this.balance = balance;
    }
}

public class Bank {
    private Map<String, BankCustomer> customers = new HashMap<>();

    public void addCustomer(BankCustomer customer) {
        customers.put(customer.getId(), customer);
    }

    public double getBalance(String id) {
        BankCustomer customer = customers.get(id);
        if (customer != null) {
            return customer.getBalance();
        }
        return -1; // 表示未找到该储户
    }

    public static void main(String[] args) {
        Bank system = new Bank();
        system.addCustomer(new BankCustomer("001", "Alice", 1000.0));
        system.addCustomer(new BankCustomer("002", "Bob", 2000.0));

        System.out.println("Alice's balance: " + system.getBalance("001"));
        System.out.println("Bob's balance: " + system.getBalance("002"));
    }
}
